/*
 * FbShowErrorMsg.h
 *
 *  Created on: 2009-1-18
 *      Author: hequn
 */

#ifndef FBSHOWERRORMSG_H_
#define FBSHOWERRORMSG_H_

// INCLUDES
#include <coecntrl.h>

//#define USE_AKNNOTEDIALOG

#ifdef USE_AKNNOTEDIALOG
#include <aknnotedialog.h>
#endif


// CLASS DECLARATION
class CFbShowErrorMsg : public CCoeControl
{
public:

	/**
	 * Two-phased constructor.
	 */
	static CFbShowErrorMsg* NewL(const TRect& aRect);

	static CFbShowErrorMsg* NewLC(const TRect& aRect);

	virtual ~CFbShowErrorMsg();
	
	/**
	 * EPOC default constructor.
	 * @param aRect Frame rectangle for container.
	 */
	void ConstructL(const TRect& aRect);
	
private: // Functions from base classes

	/**
	* From CoeControl,SizeChanged.
	*/
	void SizeChanged();

	/**
	* From CoeControl,CountComponentControls.
	*/
	TInt CountComponentControls() const;

	/**
	* From CCoeControl,ComponentControl.
	*/
	CCoeControl* ComponentControl(TInt aIndex) const;

	/**
	* From CCoeControl,Draw.
	*/
	void Draw(const TRect& aRect) const;
	
	//Below are Set some param function!
public:
	void SetMsgTitle(const TDesC& aTitle);
	
	void SetMsgContent(const TDesC& aText);
	
	void SetInterval(const TInt& aSec);	
	
private:
	//Data
#ifdef USE_AKNNOTEDIALOG
	CAknNoteDialog* m_pMsgDialog;
#endif
	
	//HBufC* p_bufTitle;
	HBufC* p_bufText;	//Warning content! Can be set ,call SetMsgContent(TDesC)
	TInt i_IntervalSec;	//interval of the callback func!
	
	CPeriodic*	iPeriodic_ForDraw;
	TInt i_Timer;
	static TInt ReDrawCallback(TAny* pInst);
	void ExitApp();
	
//	bool Has_setAlpha;//control the background need set alpha or not! 
	
public:
	bool b_CanExit;
};

#endif /* FBSHOWERRORMSG_H_ */
